package com.fowo.api.service.handleWork;

import com.fowo.api.model.logistics.withdraw.LogisticsWithdrawFinishRequestPayoutAction;
import com.fowo.api.model.logistics.withdraw.LogisticsWithdrawVo;
import com.fowo.api.service.LogisticsWithdrawService;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;

import javax.annotation.Resource;

@Component
public class LogisticsWithdrawFinishRequestPayout implements LogisticsWithdrawFinishRequestPayoutAction {

    @Resource
    private LogisticsWithdrawService logLogisticsWithdrawService;

    @Override
    public void run(Long id) throws Exception {
        LogisticsWithdrawVo LogisticsWithdrawVo = logLogisticsWithdrawService.getVoById(id);
        Assert.notNull(LogisticsWithdrawVo,"单据不存在");
        LogisticsWithdrawVo.setStatus("40");
        logLogisticsWithdrawService.update(LogisticsWithdrawVo);
    }
}
